import request from '../utils/request'

export default {
    //管理登录
    loginApi(data) {
        return request({
            method: "POST",
            url: '/management/login',
            data
        })
    },
    //获取用户信息
    getAdminInformation() {
        return request({
            method: 'get',
            url: '/management/getusername'
        })
    },
    //获取所有管理员信息
    getAllAdmin(){
        return request({
            method: 'get',
            url:'/management/getalladmin'
        })
    },
    //修改管理员密码
    changeAdminPass(data){
        return request({
            method:'put',
            url:'/management/changeadminpass',
            data
        })
    },
    //退出登录
    loginoutApi(){
        return request({
            method: 'post',
            url:'/management/loginout'
        })
    },
    //删除管理员
    deleteAdminApi(data){
        return request({
            method:'delete',
            url:'/management/deleteadmin',
            data
        })
    },
    //获取用户列表
    getUersListApi(params){
        return request({
            method:'get',
            url:'/management/users/page',
            params
        })
    },
    //改变用户权限
    changeUserPer(id,action){
        return request({
            method:'put',
            url:`/management/users/changeper/${id}/${action}`,
        })
    },
    //添加管理员
    addAdminApi(data){
        return request({
            method:'post',
            url:'/management/admin/add',
            data
        })
    },
    //获取分享列表
    getSharesListApi(){
        return request({
            method:'get',
            url:'/management/share/list',
        })
    },
    //获取分享人
    getShareUserInfo(params){
        return request({
            method:'get',
            url:'/management/share/user',
            params
        })
    },
    //获取文件存储情况
    getDiskStorageStatus(){
        return request({
            method:'get',
            url:'/management/disk/storagestatus'
        })
    },
    //取消分享
    deleteShare(params){
        return request({
            method:'get',
            url:'/management/share/cancel',
            params
        })
    }


}